package com.zmovie.framework.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 
 * @TableName cinema
 */
@TableName(value ="cinema")
@Data
@ApiModel("电影院")
public class Cinema implements Serializable {
    /**
     * 影院id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("主键")
    private Integer id;

    /**
     * 影院名
     */
    @ApiModelProperty("电影院名称")
    @NotBlank(message = "影院名不能为空")
    private String name;

    /**
     * 影院品牌id
     */
    @ApiModelProperty("电影院品牌id")
    @NotNull(message = "电影院品牌不能为空")
    private Integer brandId;

    /**
     * 影院图片，json类型存储多张图片
     */
    @ApiModelProperty("影院图片，json类型存储多张图片")
    private String picture;

    /**
     * 能否改签，1表示可以，0表示不能
     */
    @ApiModelProperty("能否改签，1表示可以，0表示不能")
    @NotNull(message = "是否可改签信息不能为空")
    private Integer isTicketChanged;

    /**
     * 能否退款，1表示可以，0表示不能
     */
    @ApiModelProperty("能否退款，1表示可以，0表示不能")
    @NotNull(message = "是否可退款不能为空")
    private Integer isRefunded;

    /**
     * 所属区域id
     */
    @ApiModelProperty("所属区域id")
    @NotNull(message = "所属区域不能为空")
    private Integer areaId;

    /**
     * 详细地址
     */
    @ApiModelProperty("详细地址")
    @NotBlank(message = "详细地址不能为空")
    private String address;

    /**
     * 联系人(负责人)id
     */
    @ApiModelProperty("联系人(负责人)id")
    @NotNull(message = "联系人不能为空")
    private Integer userId;

    /**
     * 影院入驻日期
     */
    @ApiModelProperty("影院入驻日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "影院入驻日期不能为空")
    private Date entryDate;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Cinema other = (Cinema) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
            && (this.getPicture() == null ? other.getPicture() == null : this.getPicture().equals(other.getPicture()))
            && (this.getIsTicketChanged() == null ? other.getIsTicketChanged() == null : this.getIsTicketChanged().equals(other.getIsTicketChanged()))
            && (this.getIsRefunded() == null ? other.getIsRefunded() == null : this.getIsRefunded().equals(other.getIsRefunded()))
            && (this.getAreaId() == null ? other.getAreaId() == null : this.getAreaId().equals(other.getAreaId()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getEntryDate() == null ? other.getEntryDate() == null : this.getEntryDate().equals(other.getEntryDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getPicture() == null) ? 0 : getPicture().hashCode());
        result = prime * result + ((getIsTicketChanged() == null) ? 0 : getIsTicketChanged().hashCode());
        result = prime * result + ((getIsRefunded() == null) ? 0 : getIsRefunded().hashCode());
        result = prime * result + ((getAreaId() == null) ? 0 : getAreaId().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getEntryDate() == null) ? 0 : getEntryDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", brandId=").append(brandId);
        sb.append(", picture=").append(picture);
        sb.append(", isTicketChanged=").append(isTicketChanged);
        sb.append(", isRefunded=").append(isRefunded);
        sb.append(", areaId=").append(areaId);
        sb.append(", address=").append(address);
        sb.append(", userId=").append(userId);
        sb.append(", entryDate=").append(entryDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}